package dlg.code.proxy.jdkproxy;

import dlg.code.proxy.IRender;
import dlg.code.proxy.Render;
import dlg.code.proxy.RenderImpl;

public class Client {
    public static void main(String[] args) {
        IRender render = new Render();
        IRender proxy = new ProxyInvocationHandler<>(render).getProxy();
        proxy.rent();
        System.out.println("proxy = " + proxy);

        // 不是接口
//        RenderImpl render2 = new RenderImpl();
//        RenderImpl proxy1 =(RenderImpl) new ProxyInvocationHandler<>(render2).getProxy();
//        System.out.println("proxy1 = " + proxy1);
    }
}
